<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>浏览器反调试 | Amoxuk</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="浏览器反调试代码使用定时器和debugger以及时间对比实现的反调试功能12345678910111213141516171819setTimeout(function() &amp;#123;    var s = new Date().valueOf();    try &amp;#123;        (function z() &amp;#123;            debugger ;z();">
<meta property="og:type" content="article">
<meta property="og:title" content="浏览器反调试">
<meta property="og:url" content="https://amoxuk.gitee.io/2019/03/08/浏览器反调试/index.html">
<meta property="og:site_name" content="Amoxuk">
<meta property="og:description" content="浏览器反调试代码使用定时器和debugger以及时间对比实现的反调试功能12345678910111213141516171819setTimeout(function() &amp;#123;    var s = new Date().valueOf();    try &amp;#123;        (function z() &amp;#123;            debugger ;z();">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-03-08T15:34:19.838Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="浏览器反调试">
<meta name="twitter:description" content="浏览器反调试代码使用定时器和debugger以及时间对比实现的反调试功能12345678910111213141516171819setTimeout(function() &amp;#123;    var s = new Date().valueOf();    try &amp;#123;        (function z() &amp;#123;            debugger ;z();">
  
    <link rel="alternate" href="/atom.xml" title="Amoxuk" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.ico">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Amoxuk</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://amoxuk.gitee.io"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-浏览器反调试" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/03/08/浏览器反调试/" class="article-date">
  <time datetime="2019-03-08T15:31:21.000Z" itemprop="datePublished">2019-03-08</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      浏览器反调试
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="浏览器反调试代码"><a href="#浏览器反调试代码" class="headerlink" title="浏览器反调试代码"></a>浏览器反调试代码</h2><p>使用定时器和debugger以及时间对比实现的反调试功能<br><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">setTimeout(<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> s = <span class="keyword">new</span> <span class="built_in">Date</span>().valueOf();</span><br><span class="line">    <span class="keyword">try</span> &#123;</span><br><span class="line">        (<span class="function"><span class="keyword">function</span> <span class="title">z</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="keyword">debugger</span> ;z();</span><br><span class="line">        &#125;</span><br><span class="line">        )();</span><br><span class="line">    &#125; <span class="keyword">catch</span> (e) &#123;&#125;</span><br><span class="line">    <span class="keyword">if</span> ((<span class="keyword">new</span> <span class="built_in">Date</span>().valueOf() &lt; s) || (<span class="keyword">new</span> <span class="built_in">Date</span>().valueOf() - s) &gt; <span class="number">1094</span>) &#123;</span><br><span class="line">        <span class="keyword">var</span> H2eeee = <span class="number">2</span>;</span><br><span class="line">        <span class="keyword">while</span> (H2eeee !== <span class="number">1</span>) &#123;</span><br><span class="line">            <span class="keyword">switch</span> (H2eeee) &#123;</span><br><span class="line">            <span class="keyword">case</span> <span class="number">2</span>:</span><br><span class="line">                H2eeee = <span class="number">1</span>;</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;, <span class="number">0</span>);</span><br></pre></td></tr></table></figure></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://amoxuk.gitee.io/2019/03/08/浏览器反调试/" data-id="cjt0816q500029cjjmsatw6vc" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/03/10/client/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          (no title)
        
      </div>
    </a>
  
  
    <a href="/2019/03/04/amo/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Hexo 部署到 Github</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/03/10/client/">(no title)</a>
          </li>
        
          <li>
            <a href="/2019/03/08/浏览器反调试/">浏览器反调试</a>
          </li>
        
          <li>
            <a href="/2019/03/04/amo/">Hexo 部署到 Github</a>
          </li>
        
          <li>
            <a href="/2019/03/04/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 amoxuk<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>